//
//  locationController.m
//  cwRadio
//
//  Created by Raf Pauwels on 24/11/10.
//  Copyright 2010 __MyCompanyName__. All rights reserved.
//

#import "locationController.h"
#import <CoreLocation/CoreLocation.h>

@implementation locationController

@synthesize locationManager;
@synthesize delegate;

-(id) init {
	self = [super init];
	if(self!=nil) {
		self.locationManager = [[[CLLocationManager alloc] init] autorelease];
		self.locationManager.delegate = self;
	}
	return self;
}

- (void)locationManager:(CLLocationManager*)manager
didUpdateToLocation:(CLLocation*)newLocation
fromLocation:(CLLocation*)oldLocation
{
	[self.delegate locationUpdate:newLocation];
}
- (void)locationManager:(CLLocationManager*)manager
	   didFailWithError:(NSError*)error{
	[self.delegate locationError:error];
}

- (void)dealloc {
	[self.locationManager release];
	[super dealloc];
}
@end

